package design_pattern.lx2_abstract_factory_pattern;


import design_pattern.lx2_abstract_factory_pattern.impl.Circle;
import design_pattern.lx2_abstract_factory_pattern.impl.Rectangle;
import design_pattern.lx2_abstract_factory_pattern.impl.Square;

/**
 * @Author Mr.wang
 * @Description
 * @Date 2020-04-01
 */
public class ShapeFactory extends AbstractFactory {
    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shapeType) {
        if (shapeType == null) {
            return null;
        }
        if (shapeType.equalsIgnoreCase("CIRCLE")) {
            return new Circle();
        }
        if (shapeType.equalsIgnoreCase("RECTANGLE")) {
            return new Rectangle();
        }
        if (shapeType.equalsIgnoreCase("SQUARE")) {
            return new Square();
        }
        return null;
    }
}
